package cn.hg.solon.youcan.system.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class SysOperateLogTableDef extends TableDef {

    /**
     * 实体类。

 @author 胡高
 @since 2023-06-20
     */
    public static final SysOperateLogTableDef SYS_OPERATE_LOG = new SysOperateLogTableDef();

    /**
     * ID
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * IP地址
     */
    public final QueryColumn IP = new QueryColumn(this, "ip");

    /**
     * 请求URL
     */
    public final QueryColumn URL = new QueryColumn(this, "url");

    /**
     * 消耗时间（ms)
     */
    public final QueryColumn COST = new QueryColumn(this, "cost");

    /**
     * 操作类型：OTHER 其他操作，CREATE 新增操作，UPDATE 修改操作，DELETE 删除操作，GRANT 授权操作，EXPORT 导出操作，IMPORT 导入操作，EXIT 强退操作，GENERATE 生成操作，CLEAR 清空操作
     */
    public final QueryColumn TYPE = new QueryColumn(this, "type");

    /**
     * 请求参数
     */
    public final QueryColumn PARAM = new QueryColumn(this, "param");

    /**
     * 模块标题
     */
    public final QueryColumn TITLE = new QueryColumn(this, "title");

    /**
     * 部门ID
     */
    public final QueryColumn DEPT_ID = new QueryColumn(this, "dept_id");

    /**
     * 方法名称
     */
    public final QueryColumn METHOD = new QueryColumn(this, "method");

    /**
     * 返回参数
     */
    public final QueryColumn RESULT = new QueryColumn(this, "result");

    /**
     * 操作状态：SUCCESS 成功，FAIL 失败
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 操作人ID
     */
    public final QueryColumn USER_ID = new QueryColumn(this, "user_id");

    /**
     * 错误消息
     */
    public final QueryColumn MESSAGE = new QueryColumn(this, "message");

    /**
     * 部门名
     */
    public final QueryColumn DEPT_NAME = new QueryColumn(this, "dept_name");

    /**
     * 操作地点
     */
    public final QueryColumn LOCATION = new QueryColumn(this, "location");

    /**
     * 操作人员
     */
    public final QueryColumn USER_NAME = new QueryColumn(this, "user_name");

    /**
     * 请求方式
     */
    public final QueryColumn REQUEST_METHOD = new QueryColumn(this, "request_method");

    /**
     * 操作时间
     */
    public final QueryColumn ACTION_DATETIME = new QueryColumn(this, "action_datetime");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, IP, URL, COST, TYPE, PARAM, TITLE, DEPT_ID, METHOD, RESULT, STATUS, USER_ID, MESSAGE, DEPT_NAME, LOCATION, USER_NAME, REQUEST_METHOD, ACTION_DATETIME};

    public SysOperateLogTableDef() {
        super("", "sys_operate_log");
    }

    private SysOperateLogTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public SysOperateLogTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new SysOperateLogTableDef("", "sys_operate_log", alias));
    }

}
